perm filename SAILPD.FAI[S,AIL]1 blob
sn#186798 filedate 1975-11-18 generic text, type T, neo UTF8
00100 COMMENT ⊗ VALID 00002 PAGES
00200 C REC PAGE DESCRIPTION
00300 C00001 00001
00400 C00002 00002 SAILPD -- a FAIL macro to define SAIL procedure descriptors
00500 C00005 ENDMK
00600 C⊗;
00100 ;SAILPD -- a FAIL macro to define SAIL procedure descriptors
00200 ; (BAIL needs a procedure descriptor in order to call anything)
00300 ;
00400 ;Arguments are
00500 ; NAME must be defined as entry address, also used as name of proc
00600 ; PROCTYP type of procedure
00700 ; PPARMS number of parameters passed on P ('17) stack
00800 ; SPPARM number of parameters passed on SP ('16) stack
00900 ; (same as number of VALUE STRINGs)
01000 ; ARGTYPS list of argument types
01100 ;
01200 ;For a procedure corresponding to the SAIL declaration
01300 ; INTEGER PROCEDURE MYPROC
01400 ; (REFERENCE INTEGER I; STRING S; INTEGER J; INTEGER K[13])
01500 ;an acceptable macro call is
01600 ; SAILPD (MYPROC,INTEGR,3,1,<REFERENCE+INTEGR,STRING,INTEGR,
01700 ; INTEGR+DEFAULT+[=13]>)
01800 ;
01900
02000 DEFINE SAILPD (NAME,PROCTYP,PPARMS,SPPARM,ARGTYPS) <
02100 BEGIN
02200 XPUNGE ;NO SYMBOLS FROM THIS BLOCK IN .REL FILE
02300 %PDLNK ←← 6 ;PROCEDURE DESCRIPTOR LOADER LINK
02400
02500 DEFAUL ←← 1⊗=35
02600 REFERE ←← 1⊗=34
02700 QUES ←← 1⊗=33
02800 BIND ←← 1⊗=32
02900 PROCED ←← 1⊗=31
03000 ITEM ←← 1⊗=30
03100 LEAPAR ←← 1⊗=29 ;LEAP ARRAY, FOR λ ARRAY ITEMVAR ARRAY
03200
03300 NOTYPE ←← 1⊗=23
03400 STRING ←← 3⊗=23
03500 REAL ←← 4⊗=23
03600 INTEGR ←← 5⊗=23 ;INTEGER IS FAIL RESERVED WORD
03700 SSET ←← 6⊗=23 ;SET IS FAIL RESERVED WORD
03800 LIST ←← 7⊗=23
03900 CONTEX ←← 13⊗=23
04000 RECPTR ←← 15⊗=23 ;RECORD!POINTER
04100 ITEMVA ←← 20⊗=23
04200
04300 ARRAY ←← 24⊗=23
04400
04800
04900 0 ;LOADER CHAIN
05000 LINK %PDLNK,.-1
05100 NAME ;ENTRY ADDRESS
05200
05300 FOR @$ ZOT E <NAME><1+>0 ;LENGTH
05500 POINT 7,[ASCII/NAME/],-1
05600
05700 PROCTYP
05800 2*SPPARM,,1+PPARMS
05900 0 ;STACK DISPLACEMENTS
06000 0 ;LOCAL VARIABLE INFO
06100 .+4 ;PTR TO PARAM INFO
06200 .-10,,0 ;PDA,,0
06300 NAME,,0 ;PCNT AT MKSEMT,,PARENT'S PDA
06400 NAME,,0 ;PCNT AT PRDEC,,JRST EXIT
06500
06600 FOR ZOT IN (ARGTYP)<
06700 ZOT> ;PARAMETER TYPES
06800
06900 BEND>
07000
07100 ;TITLE TEST
07200 ;MYPROC:0
07300 ; SAILPD (MYPROC,INTEGR,3,1,<REFERENCE+INTEGR,STRING,INTEGR,
07400 ; INTEGR+DEFAULT+[=13]>)
07500 ;END